package com.ungao.tools.generator.builder;

import java.util.Objects;

public abstract class AbstractBuilder<R, T, B extends AbstractBuilder> implements IBuilder<R, B> {

    /**
     * 返回对象
     */
    protected R tables;

    /**
     * 表名数据
     */
    protected T names;

    /**
     * 表名前缀
     */
    protected T alias;

    public AbstractBuilder(T names, R tables) {
        Objects.requireNonNull(names, "the table names is not to be null!");
        Objects.requireNonNull(tables, "the table tables is not to be null!");
        this.names = names;
        this.tables = tables;
    }

    public AbstractBuilder(T names, T alias, R tables) {
        this.tables = tables;
        this.names = names;
        this.alias = alias;
    }

    public R getTables() {
        return tables;
    }

    public void setTables(R tables) {
        this.tables = tables;
    }

    public T getNames() {
        return names;
    }

    public void setNames(T names) {
        this.names = names;
    }

    public T getAlias() {
        return alias;
    }

    public void setAlias(T alias) {
        this.alias = alias;
    }
}
